#!/usr/bin/env bash

# Regex & Usage
commit_regex="^(\[\S+(\s\&\s\S+)*\]|merge)\s"
error_message="Aborting commit. Commit message must start with [YOUR NAME]."
usage="[YOUR NAME] Commit Message."

if ! grep -qE "$commit_regex" "$1"; then
  printf "error_message\n"
  printf "Commit Regex: ${commit_regex}\n"
  printf "Usage: ${usage}\n"
  exit 1
fi
